"""
@name : 2-4.使用自定义线程类
@author : wenyao
@projectname: sanchuanglianxi
"""
import threading
import  time

class MyThread(threading.Thread):
    def __init__(self,num):
        super().__init__()
        self.num = num

    def run(self):  #默认执行run方法
        print(f"running on numbers {self.num}")
        time.sleep(1)

if __name__ == "__main__":
    t1 = MyThread(1)
    t2 = MyThread(2)
    t1.start()
    t2.start()